import * as api from "@/api/comment"
export default{
    namespaced:true,
    state:{
        comments:[]
    },
    mutations:{
        //修改comments
        SET_COMMENT(state,payload){
            state.comments=payload
        }
    },
    actions:{
        async FETCH_COMMENT(context){
            //发起获取评论的请求
            let res=await api.getComment();
            console.log(res)
            context.commit("SET_COMMENT",res.data.data)
        }
    }
}